home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1988 March & April / rerun-1988-03-04.d64 / command collect (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  5.1 KB  |  169 lines

  1. 10 poke 53281,0:poke 53280,12
  2. 20 poke780,peek(55):poke781,peek(56)
  3. 30 poke55,peek(45):poke56,peek(46)+8:clr:ol=peek(780):oh=peek(781)
  4. 40 mt=peek(55)+256*peek(56)+257:mb=peek(43)+256*peek(44)-2
  5. 50 pr$="("+str$(mb)+"-"+str$(mt)+")"
  6. 60 dimc%(255)
  7. 70 print"[147]"tab(0)"     batch processor setup program      "
  8. 80 print"[156]   addresses can be in decimal or hex."
  9. 90 printtab(8)"add '$' to specify hex."
  10. 100 print"[152]start address for main patch and data:"
  11. 110 print"(64 bytes + data bytes)"
  12. 120 print"default = $a000:40960[146] ";
  13. 130 df=40960:gosub1230:s1=a
  14. 140 print"maximum end address for main patch"
  15. 150 print"and data:"
  16. 160 print"default = $bfff(49151)[146] ";
  17. 170 df=49151:gosub1230:e1=a
  18. 180 if (e1<mb) or (s1>mt) then 200
  19. 190 print"patch can't go on basic init. program":printpr$:goto100
  20. 200 if e1 > 53247 then print "patch can't be under kernal or i/o":goto100
  21. 210 if s1+64>=e1thenprint"impossible -- need at least 64 bytes!!":goto100
  22. 220 print"start address for boot (35 bytes):"
  23. 230 print"default = $033c:828[146] ";
  24. 240 df=828:gosub1230:s2=a
  25. 250 if(s2+34<mb)or(s2>mt)then270
  26. 260 print"boot can't go on basic init. program":printpr$:goto220
  27. 270 if(s2<40959-35) or (s2>49151 and s2<53247-35) then 290
  28. 280 print"boot cannot be under rom or i/o":goto220
  29. 290 p2% = not((s1<40960 and e1<40960) or (s1>=49152 and e1>=49152))
  30. 300 if not(p2%) then 390
  31. 310 print"start address for small patch"
  32. 320 print"(21 bytes):"
  33. 330 print"default = boot+35 =";s2+35;"[146]";
  34. 340 df=s2+35:gosub1230:s3=a
  35. 350 if (s3+20<mb) or (s3>mt) then 370
  36. 360 print"small patch can't go on basic init prog":printpr$:goto310
  37. 370 if not((s3>40959 and s3<49151+21)or(s3>53247))then390
  38. 380 print"small patch can't be under roms or i/o":goto310
  39. 390 print"free zero page space (2 bytes):"
  40. 400 print"default = $be:190[146] ";
  41. 410 df=190:gosub1230:zp=a
  42. 420 ifzp>254orzp<2thenprint"not a usable zero page address":goto390
  43. 430 print"[147]installing patches..."
  44. 440 de$="error in data statements "
  45. 450 ck=0:fori=0to63:readb:ck=ck+b:pokes1+i,b:next
  46. 460 readz:ifz<>-1orck<>4956thenprintde$;"5015-5110":goto1670
  47. 470 ck=0:fori=0to34:readb:ck=ck+b:pokes2+i,b:next
  48. 480 readz:ifz<>-1orck<>2266thenprintde$;"5130-5170":goto1670
  49. 490 if not(p2%) then fori=0to21:readz:next: goto 570
  50. 500 ck=0:fori=0to20:readb:ck=ck+b:pokes3+i,b:next
  51. 510 readz:ifz<>-1orck<>1079thenprintde$;"5190-5220":goto1670
  52. 520 t=s3+20:th=int(t/256):tl=t-256*th
  53. 530 poke s3+3,tl :poke s3+4,th
  54. 540 poke s3+13,tl:poke s3+14,th
  55. 550 th=int(s1/256):tl=s1-256*th
  56. 560 poke s3+10,tl:poke s3+11,th
  57. 570 if p2% then t=s3+18
  58. 580 if not(p2%) then t=s1+60
  59. 590 u=t+1
  60. 600 th=int(t/256):tl=t-256*th
  61. 610 uh=int(u/256):ul=u-256*uh
  62. 620 poke s1+34,tl:poke s1+35,th
  63. 630 poke s1+40,ul:poke s1+41,uh
  64. 640 poke s2+4,tl :poke s2+5,th
  65. 650 poke s2+10,ul:poke s2+11,uh
  66. 660 if p2% then t=s3
  67. 670 if not(p2%) then t=s1
  68. 680 th=int(t/256):tl=t-256*th
  69. 690 poke s2+14,tl
  70. 700 poke s2+19,th
  71. 710 t=s1+63
  72. 720 th=int(t/256):tl=t-256*th
  73. 730 poke s2+24,tl:poke s2+29,th
  74. 740 t=s1+62
  75. 750 u=t+1  
  76. 760 th=int(t/256):tl=t-256*th
  77. 770 uh=int(u/256):ul=u-256*uh
  78. 780 poke s2+26,tl:poke s2+27,th
  79. 790 poke s2+31,ul:poke s2+32,uh
  80. 800 poke s1+5,tl :poke s1+6,th
  81. 810 poke s1+10,ul:poke s1+11,uh
  82. 820 poke s1+13,tl:poke s1+14,th
  83. 830 poke s1+21,ul:poke s1+22,uh
  84. 840 if p2% then poke s1+59,96
  85. 850 if not(p2%) then poke s1+59,76
  86. 860 poke s1+16,zp:poke s1+24,zp+1
  87. 870 poke s1+55,zp
  88. 880 print "[147]name of command file";
  89. 890 input cf$:ifcf$=""then880
  90. 900 print"file type:";
  91. 910 print"seq, prg, or usr (s, p, or u)"
  92. 920 t$="s":input"default = s[146] ";t$
  93. 930 ift$<>"s"andt$<>"p"andt$<>"u"thenprint"type s, p, or u":goto920
  94. 940 cf$=cf$+","+t$+",r"
  95. 950 print"file format:"
  96. 960 print"screen code or commodore ascii (s or a)"
  97. 970 f$="a":input"default = a[146] ";f$
  98. 980 iff$<>"s"andf$<>"a"thenprint"type s or a":goto970
  99. 990 print "[147]reading control file..."
  100. 1000 fori=0to255:c%(i)=i:next:iff$="a"then1060
  101. 1010 fori=0to30:c%(i)=i+64:next
  102. 1020 fori=64to95:c%(i)=i+32:next:::fori=96to127:c%(i)=i+104:next
  103. 1030 fori=128to154:c%(i)=i-128:next
  104. 1040 c%(177)=133:c%(178)=137:c%(179)=134:c%(180)=138
  105. 1050 c%(181)=135:c%(182)=139:c%(183)=136:c%(184)=140::c%(31)=13
  106. 1060 open 15,8,15,"i0"
  107. 1070 open2,8,2,cf$
  108. 1080 input#15,e,e$,t,s:ife>0thenclose2:close15
  109. 1090 ife>0thenprint"disk error:[146]";e;e$;t;s:fori=1to3500:next:goto880
  110. 1100 ml=mt-256:ck=0:fori=mltoml+89:readb:ck=ck+b:pokei,b:next
  111. 1110 readz:ifz<>-1orck<>10435thenprintde$;"5310-5450":goto1670
  112. 1120 d=s1+64:iff$="a"then1140
  113. 1130 get#2,a$,b$:ifa$<>""orb$<>chr$(37)thenclose2:open2,8,2,cf$
  114. 1140 th=int(d/256):tl=d-256*th:pokeml+1,tl:pokeml+5,th
  115. 1150 th=int(e1/256):tl=e1-256*th:pokeml+63,tl:pokeml+69,th
  116. 1160 th=int(ml/256):tl=ml-256*th:poke785,tl:poke786,th
  117. 1170 t=usr(0)+1:ss=st:close2:close15
  118. 1180 ifss=0then print"[147][154]data doesn't fit.[152]":(NULL)t9000
  119. 1190 if t<0 then t=t+65536
  120. 1200 th=int(t/256):tl=t-th*256
  121. 1210 poke s1+18,tl:poke s1+29,th
  122. 1220 print "done -- sys";s2;"[157][146] to boot.":goto1680
  123. 1230 a=0:a$="":input a$
  124. 1240 ifa$=""thena=df:return
  125. 1250 if left$(a$,1) <> "$" and val(a$) > 0 then a=val(a$):return
  126. 1260 if left$(a$,1) <> "$" then 1230
  127. 1270 fori=2tolen(a$)
  128. 1280 c$=mid$(a$,i,1):ifc$<="9"andc$>="0"thena=a+val(c$)*16^(len(a$)-i):goto1300
  129. 1290 a=a+(asc(c$)-55)*16^(len(a$)-i)
  130. 1300 nexti:ifa=0then1230
  131. 1310 return
  132. 1320 data 165,198,208,55,238,0,0
  133. 1330 data 208,3,238,0,0,173,0,0
  134. 1340 data 133,0,201,0,8
  135. 1350 data 173,0,0,133,0,40
  136. 1360 data 208,21,201,0,208,17
  137. 1370 data 120,173,0,0,141,20,3
  138. 1380 data 173,0,0,141,21,3,88
  139. 1390 data 24,144,10,160,1
  140. 1400 data 132,198,136,177,0
  141. 1410 data 141,119,2,0,0,0
  142. 1420 data 0,0,-1
  143. 1430 data 173,20,3,141,0,0,173,21,3
  144. 1440 data 141,0,0,120,169,0
  145. 1450 data 141,20,3,169,0,141,21,3
  146. 1460 data 169,0,141,0,0,169,0
  147. 1470 data 141,0,0,88,96,-1
  148. 1480 data 165,1,141,0,0,169,54
  149. 1490 data 133,1,32,0,0,173,0,0
  150. 1500 data 133,1,76,0,0
  151. 1510 data 0,-1
  152. 1520 data 169,0,133,99,169,0
  153. 1530 data 133,100,24,165,47,105,8
  154. 1540 data 133,97,165,48,105,0
  155. 1550 data 133,98,162,2,32,198,255
  156. 1560 data 32,228,255,10,133,101
  157. 1570 data 169,0,42,133,102,24
  158. 1580 data 165,97,101,101,133,101
  159. 1590 data 165,98,101,102,133,102
  160. 1600 data 160,0,177,101,145,99
  161. 1610 data 165,144,208,20,165,99
  162. 1620 data 201,0,208,6,165,100
  163. 1630 data 201,0,240,8,230,99
  164. 1640 data 208,206,230,100,208,202
  165. 1650 data 32,204,255,164,99,165,100
  166. 1660 data 108,5,0,-1
  167. 1670 poke55,ol:poke56,oh:clr:end
  168. 1680 poke55,ol:poke56,oh:new
  169.